import {
  ApartmentOutlined,
  DesktopOutlined,
  FileTextOutlined,
  FlagOutlined,
  FolderFilled,
  LockOutlined,
  UserOutlined,
} from '@ant-design/icons';
import type { MenuProps } from 'antd';
import React from 'react';
type MenuItem = Required<MenuProps>['items'][number];

function getItem(
  label: React.ReactNode,
  key: React.Key,
  icon?: React.ReactNode,
  children?: MenuItem[],
): MenuItem {
  return {
    key,
    icon,
    children,
    label,
  } as MenuItem;
}

const items: MenuItem[] = [
  getItem('系统', 'menusub1', <ApartmentOutlined />),
  getItem('设备管理', 'menusub2', <DesktopOutlined />, [
    getItem('设备信息', 'menu6'),
    getItem('设备状态', 'menu5'),
    getItem('设备配置', 'menu7'),
  ]),
  getItem('密钥管理', 'menusub3', <LockOutlined />),
  getItem('文件管理', 'menusub6', <FolderFilled />),
  getItem('用户管理', 'menusub5', <UserOutlined />),
  getItem('日志管理', 'menusub4', <FileTextOutlined />, [
    getItem('管理日志', 'menu1'),
    getItem('接口日志', 'menu4'),
    getItem('系统日志', 'menu3'),
  ]),
  getItem('访问控制', 'menusub7', <FlagOutlined />),
];

export default items;
